home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / amiga / asrc29k.lha / smtp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  2.6 KB  |  88 lines

  1. #ifndef    _SMTP_H
  2. #define    _SMTP_H
  3.  
  4. #define    SMTPTRACE            /* enable tracing for smtp */
  5. #define    MAXSESSIONS    10        /* most connections allowed */
  6. #define    JOBNAME        13        /* max size of a job name with null */
  7. #define    MBOXLEN        32        /* max size of a mail box name */
  8.  
  9. /* types of address used by smtp in an address list */
  10. #define    BADADDR    0
  11. #define    LOCAL    1
  12. #define    DOMAIN    2
  13.  
  14. /* a list entry */
  15. struct list {
  16.     struct list *next;
  17.     char *val;
  18.     char type;
  19. };
  20.  
  21. /* Per-session control block  used by smtp server */
  22. struct smtpsv {
  23.     int s;            /* the socket for this connection */
  24.     char *system;        /* Name of remote system */
  25.     char *from;        /* sender address */
  26.     struct list *to;    /* Linked list of recipients */
  27.     FILE *data;        /* Temporary input file pointer */
  28. };
  29.  
  30. /* used by smtpcli as a queue entry for a single message */
  31. struct smtp_job {
  32.     struct     smtp_job *next;    /* pointer to next mail job for this system */
  33.     char    jobname[9];    /* the prefix of the job file name */
  34.     char    *from;        /* address of sender */
  35.     struct list *to;    /* Linked list of recipients */
  36. };
  37.  
  38. /* control structure used by an smtp client session */
  39. struct smtpcli {
  40.     int     s;        /* connection socket */
  41.     int32    ipdest;        /* address of forwarding system */
  42.     char    *destname;    /* domain address of forwarding system */
  43.     char    *wname;        /* name of workfile */
  44.     char    *tname;        /* name of data file */
  45.     char    buf[LINELEN];    /* Output buffer */
  46.     char    cnt;        /* Length of input buffer */
  47.     FILE    *tfile;
  48.     struct    smtp_job *jobq;
  49.     struct    list     *errlog;    
  50.     int lock;        /* In use */
  51. };
  52.  
  53. /* smtp server routing mode */
  54. #define    QUEUE    1
  55.  
  56. #define    NULLLIST        (struct list *)0
  57. #define    NULLSMTPSV    (struct smtpsv *)0
  58. #define    NULLSMTPCLI    (struct smtpcli *)0
  59. #define    NULLJOB        (struct smtp_job *)0
  60.  
  61. extern int Smtpmode;
  62. extern char *Mailspool;
  63. extern char *Mailqdir;        /* Outgoing spool directory */
  64. extern char *Routeqdir;    /* spool directory for a router program */
  65. extern char *Mailqueue;    /* Prototype of work file */
  66. extern char *Maillock;        /* Mail system lock */
  67. extern char *Alias;        /* File of local aliases */
  68.  
  69. /* In smtpserv.c: */
  70. char *ptime __ARGS((long *t));
  71. long get_msgid __ARGS((void));
  72. char *getname __ARGS((char *cp));
  73. int validate_address __ARGS((char *s));
  74. int queuejob __ARGS((FILE *dfile,char *host,struct list *to,char *from));
  75. struct list *addlist __ARGS((struct list **head,char *val,int type));
  76.  
  77. int mailuser __ARGS((FILE *data,char *from,char *to));
  78.  
  79. /* In smtpcli.c: */
  80. int smtptick __ARGS((void *t));
  81. int mlock __ARGS((char *dir,char *id));
  82. int rmlock __ARGS((char *dir,char *id));
  83. void del_list __ARGS((struct list *lp));
  84. int32 mailroute __ARGS((char *dest));
  85.  
  86. #endif    /* _SMTP_H */
  87.  
  88.